package com.example.spider.jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.net.MalformedURLException;
import java.net.URL;

public class demo {
    public static void main(String[] args) throws Exception {

        //解析地址获取文件
        Document doc = Jsoup.parse(new URL("https://nipic.com/"), 1000);

        //获取标题
        String title = doc.getElementsByTag("title").first().text();

        System.out.println(title);
    }
}
